sampleSizeTTestDialog <- function(){
	initializeDialog(title=gettext("Sample Size Calculation t-Test", domain="R-RcmdrPlugin.TeachingExtras"))
	onOK <- function(){
		type <- as.character(tclvalue(typeVariable))
		alternative <- as.character(tclvalue(alternativeVariable))
		delta <- tclvalue(deltaVariable)
		sd <- tclvalue(sdVariable)
		sig <- tclvalue(sigVariable)
		pow <- tclvalue(powVariable)
		closeDialog()
		doItAndPrint(paste("power.t.test(delta =", delta, ", sd=", sd, ", sig.level=", sig,	", power=", pow, ", type='", type, "', alternative='", alternative, "')", sep=""))
		tkdestroy(top)
		tkfocus(CommanderWindow())
	}
	OKCancelHelp(helpSubject="power.t.test")
	radioButtons(top, name="type", buttons=c("onesample", "twosample","paired"), values=c("one.sample","two.sample", "paired"),
			labels=gettext(c("One sample", "Two independent samples", "Paired samples"), domain="R-RcmdrPlugin.TeachingExtras"), title=gettext("Type of test", domain="R-RcmdrPlugin.TeachingExtras"))
	rightFrame <- tkframe(top)
	deltaFrame <- tkframe(rightFrame)
	deltaVariable <- tclVar("1.0")
	deltaField <- ttkentry(deltaFrame, width="8", textvariable=deltaVariable)
	sdFrame <- tkframe(rightFrame)
	sdVariable <- tclVar("1.0")
	sdField <- ttkentry(sdFrame, width="8", textvariable=sdVariable)
	sigFrame <- tkframe(rightFrame)
	sigVariable <- tclVar(".05")
	sigField <- ttkentry(sigFrame, width="6", textvariable=sigVariable)
	powFrame <- tkframe(rightFrame)
	powVariable <- tclVar(".80")
	powField <- ttkentry(powFrame, width="6", textvariable=powVariable)
	radioButtons(name="alternative", buttons=c("twosided", "onesided"), values=c("two.sided", "one.sided"),
			labels=gettext(c("Two sided", "One sided"), domain="R-RcmdrPlugin.TeachingExtras"), title=gettext("Alternative hypothesis", domain="R-RcmdrPlugin.TeachingExtras"))
	tkgrid(labelRcmdr(deltaFrame, text=gettext("True difference in means: ", domain="R-RcmdrPlugin.TeachingExtras")), deltaField, sticky="w")
	tkgrid(deltaFrame, sticky="w")
	tkgrid(labelRcmdr(sdFrame, text=gettext("St.Desviation: ", domain="R-RcmdrPlugin.TeachingExtras")), sdField, sticky="w")
	tkgrid(sdFrame, sticky="w")
	tkgrid(labelRcmdr(sigFrame, text=gettext("Sig. Level: ", domain="R-RcmdrPlugin.TeachingExtras")), sigField, sticky="w")
	tkgrid(sigFrame, sticky="w")
	tkgrid(labelRcmdr(powFrame, text=gettext("Power: ", domain="R-RcmdrPlugin.TeachingExtras")), powField, sticky="w")
	tkgrid(powFrame, sticky="w")
	tkgrid(typeFrame, rightFrame, sticky="nw")
	tkgrid(alternativeFrame,sticky="w")
	tkgrid(buttonsFrame, columnspan=2, sticky="w")
	dialogSuffix(rows=4, columns=2)
}